//引入Layout组件
import Layout from '@/layout'
export const constantRoutes=[  
    //注册登录路由  
    { 
      path: '/login',
      component: () => import('@/views/login/index'),
      hidden: true
    },
      //注册404路由
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    },
    {
    //注册的是首页的路由
      path:'/',
      component:Layout,
      redirect:'/dashboard',
      children:[{
            path:'dashboard',
            name:'Dashboard',
            component:()=>import('@/views/dashboard/index'),
            meta:{title:'首 页',icon:'dashboard'}
        }]
    },
    {
     //注册商品管理模块的路由
      name:'Product',
      path:'/product',
      component:Layout,
      redirect:'/product/category/list',
      meta:{title:'商品管理',icon:'el-icon-s-shop'},
      //注册分类管理路由
      children:[
            {
            name:'Category',
            path:'category/list',
            component:()=>import('@/views/product/category'),
            meta:{title:'分类管理'}
           },
           //注册品牌管理路由
           {
            name:'Trademark',
            path:'trademark/list',
            component:()=>import('@/views/product/trademark'),
            meta:{title:'品牌管理'}
           },
           //注册平台属性
           {
            name:'Attr',
            path:'attr/list',
            component:()=>import('@/views/product/attr'),
            meta:{title:'平台属性管理'}
           },
           //注册SPU路由
           {
            name:'Spu',
            path:'spu/list',
            component:()=>import('@/views/product/spu'),
            meta:{title:'SPU管理'}
           },
            //注册Sku路由
            {
                name:'Sku',
                path:'sku/list',
                component:()=>import('@/views/product/sku'),
                meta:{title:'SKU管理'}
               },

      ]
    },
      //任意路由
      {path:'*',redirect:'/404',hidden:true}
]
